<?php
namespace Admin\Controller;
header('Content-Type:text/html;charset=utf-8');

class ShopclassController extends AdminController{
	public function category()
    {   
        $res=$this->digui(0);
        $this->assign('res',$res);
        $this->display();
    }
    public function digui($id,$arr=array(),$lv=0){
        $res=M('Classify')->Where(array('fid'=>$id))->select();
        if($res){
        	$lv++;
            foreach ($res as $v) {
                  $v['lv']=$lv; 
             	  $arr[]=$v;
                  $arr=$this->digui($v['id'],$arr,$lv);
             }
        }
        return $arr;
    }
}